<div class="popup_body">
    <div class="ui_table">
        <form>
            <input type="hidden" name="id" value="${(entity.id)!''}">
            <input type="hidden" name="activeFlag" value="${(entity.activeFlag)!''}" id="active_flag_${pid}">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td align="right">运营商名称：</td>
                    <td><input type="text" class="text easyui-validatebox" required="true" name="agentName"
                               maxlength="20" value="${(entity.agentName)!''}"/></td>
                </tr>
                <tr>
                    <td align="right">负责人姓名：</td>
                    <td>
                        <input type="text" class="text easyui-validatebox" required="true" name="principalName"
                               maxlength="20" value="${(entity.principalName)!''}" />
                    </td>
                </tr>
                <tr>
                    <td align="right">联系电话：</td>
                    <td>
                        <input type="text" class="text easyui-validatebox" required="true" name="tel"
                               value="${(entity.tel)!''}" maxlength="17"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">微信：</td>
                    <td>
                        <input type="text"  class="text easyui-validatebox" required="true" name="weChat"
                               maxlength="20" value="${(entity.weChat)!''}"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">省份城市：</td>
                    <td>
                        <div class="select_city" style="width:210px;" >
                        <#assign areaText=''>
                        <#if (entity.provinceName)??>
                            <#assign provinceName=entity.provinceName>
                            <#assign areaText=entity.provinceName>
                        </#if>
                        <#if (entity.cityName)??>
                            <#assign cityName=entity.cityName>
                            <#assign areaText=areaText + ' - ' + entity.cityName>
                        </#if>
                        <#if (entity.districtName)??>
                            <#assign districtName=entity.districtName>
                            <#assign areaText=areaText + ' - ' + entity.districtName>
                        </#if>

                        <#if (entity.provinceId)??>
                            <#assign provinceId=entity.provinceId>
                        </#if>
                        <#if (entity.cityId)??>
                            <#assign cityId=entity.cityId>
                        </#if>
                        <#if (entity.districtId)??>
                            <#assign districtId=entity.districtId>
                        </#if>
                    <#include '../../basic/area/select_area.ftl'>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">详细地址：</td>
                    <td>
                        <input type="text"  class="text easyui-validatebox" required="true" name="detailAddress"
                               value="${(entity.detailAddress)!''}" maxlength="40"/>
                    </td>
                </tr>

                <tr>
                    <td align="right">备注：</td>
                    <td><textarea name="memo" maxlength="20">${(entity.memo)!''}</textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<div class="popup_btn">
    <button class="btn btn_red ok">确定</button>
    <button class="btn btn_border close">关闭</button>
</div>
<script>
    (function () {
        var pid = '${pid}',
                win = $('#' + pid),
                form = win.find('form');

        win.find('button.ok').click(function () {
            form.form('submit', {
                url: '${contextPath}/security/basic/agent/update.htm',
                success: function (text) {
                    var json = $.evalJSON(text);
                <@app.json_jump/>
                    if (json.success) {
                        $.messager.alert('提示信息', '操作成功', 'info');
                        win.window('close');
                    } else {
                        $.messager.alert('提示信息', json.message, 'info');
                    }
                }
            });
        });
        win.find('button.close').click(function () {
            win.window('close');
        });

    })()
</script>
